<?xml version="1.0"?> 
<xsl:stylesheet 
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  version="1.0"> 
  <xsl:output method="html"/> 
 
  <xsl:template match="/r/package"> 
	
	<table width="400px">
		<input type="hidden" name="id" id="id" value="{@id}" />
		<tr>
	        <td width="35%">Name:</td>
	        <td width="65%"><input id="name" name="name" value="{@name}"/></td>
	    </tr>
	    <tr>
	        <td>URI:</td>
	        <td><input id="uri" name="uri" value="{@uri}"/></td>
	    </tr>
	    <tr>
	        <td>ownedType:</td>
	        <td>
            <ul>
              <xsl:for-each select="./ownedType">
                <li>
                  <xsl:value-of select="@name" />
                </li>
              </xsl:for-each>
            </ul>
	        </td>
	    </tr>
	    <tr>
	        <td>nestingPackage</td>
	        <td>
            <xsl:value-of select="@nestingPackage" />
          </td>
	    </tr>
	    <tr>
	        <td>nestedPackage</td>
	        <td>
            <ul>
        	    <xsl:for-each select="./nestedPackage">
                <li>
                  <xsl:value-of select="@name" />
                </li>
        	    </xsl:for-each>
            </ul>
          </td>
	    </tr>
		<tr>
	        <td>ownedComment:</td>
	        <td>
	        	<xsl:for-each select="./ownedComment">
	        		<xsl:value-of select="@id" />:
	        		<p><xsl:value-of select="@body" /></p>
    			</xsl:for-each>
			</td>
	    </tr>	    
		<tr>
	        <td>tag</td>
	        <td>
	        	<xsl:for-each select="./tag">
	        		<p><xsl:value-of select="@name" />: <xsl:value-of select="@value" /></p>
    			</xsl:for-each>
			</td>
	    </tr>	    
	    <tr>
	        <td>Insert new elements:</td>
	        <td>
	        	Types:
	        	<ul>
	        		<li><a href="javascript:createClass('{@id}')">Class</a></li>
	        		<li><a href="javascript:createEnumeration('{@id}')">Enumeration</a></li>
	        		<li><a href="javascript:createPrimitiveType('{@id}')">PrimitiveType</a></li>
	        	</ul>
	        	<br />
	        	<a href="javascript:createPackage('{@id}')">Package</a><br />
	        	<a href="javascript:createComment('{@id}')">Comment</a><br />
	        	<a href="javascript:createTag('{@id}')">Tag</a><br />
			</td>
	    </tr>
	    <tr>
	        <td colspan="2" align="center"><button onclick="javascript:savePackage('{@id}')">Save</button></td>
	    </tr>
	</table>
	</xsl:template>  
</xsl:stylesheet> 
